package com.novel.controller.system;

import com.github.pagehelper.PageInfo;
import com.novel.pojo.system.SysLog;
import com.novel.service.SysLogService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;


@Slf4j
@RestController
@RequestMapping("syslog")
public class SysLogController {

    @Autowired
    private SysLogService logService;


    /**
     * 分页查询操作日志信息
     *
     * @param pageNum  页号
     * @param pageSize 页大小
     */
    @GetMapping("list")
    public PageInfo<SysLog> querySysLogList(@RequestParam(required = false, defaultValue = "1") Integer pageNum,
                                            @RequestParam(required = false, defaultValue = "10") Integer pageSize) {
        return logService.querySysLogListByPage(pageNum, pageSize);
    }


}